# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=akonadi-contacts
pkgver=24.02.2
pkgrel=0
pkgdesc="Libraries and daemons to implement Contact Management in Akonadi"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by akonadi
# ppc64le blocked by qt6-qtwebengine -> akonadi
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later AND GPL-2.0-or-later AND BSD-3-Clause"
depends_dev="
	akonadi-dev
	gpgme-dev
	grantlee-dev
	grantleetheme-dev
	kcodecs-dev
	kcompletion-dev
	kconfig-dev
	kcontacts-dev
	kdbusaddons-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kmime-dev
	kservice-dev
	ktextaddons-dev
	ktexttemplate-dev
	ktextwidgets-dev
	kwidgetsaddons-dev
	kxmlgui-dev
	libkleo-dev
	prison-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/pim/akonadi-contacts.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-contacts-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
2e93db90e91ebc108006beac962636c7448b418b4229fb76bf4fe165506e7b4aa7c9b70054a6ce8caf4f7846d61e47a9a7072d631f9c0ab8da9f43b66127d82e  akonadi-contacts-24.02.2.tar.xz
"
